<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>同业合作渠道</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>

    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <link rel="stylesheet" href="./css/style.css">
    <link rel="stylesheet" href="./css/jquery.treetable.css">
    <link rel="stylesheet" href="./css/jquery.treetable.theme.default.css">
</head>

<body>
<div class="x-body">
    <xblock >
        <div class="people-box">
            <ul>
                <li>部门总监</li>
                <li>徐鑫</li>
            </ul>
            <ul>
                <li>成员人数</li>
                <li>20人</li>
            </ul>
        </div>
    </xblock>


    <table class="layui-table" id="treeTable1" lay-skin="line">

        <thead>
        <tr>
            <th class="s2">职级
                <button class="layui-btn layui-btn-mini zk">展开</button><button class="layui-btn layui-btn-mini layui-btn-normal gb">收起</button>
            </th>
            <th>姓名</th>
            <th>职位</th>
            <th>性别</th>
            <th>邮箱</th>
            <th>手机</th>
        </tr>
        </thead>
        <tbody>
        <tr data-tt-id="0">
            <td >总监（1人）</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr data-tt-id="1" data-tt-parent-id="0">
            <td ></td>
            <td>徐鑫</td>
            <td>技术总监</td>
            <td>男</td>
            <td>afafa@163.com</td>
            <td>1342130987</td>
        </tr>
        <tr data-tt-id="1">
            <td >主管(3人）</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr data-tt-id="2" data-tt-parent-id="1">
            <td ></td>
            <td>张三</td>
            <td>技术总监</td>
            <td>男</td>
            <td>afafa@163.com</td>
            <td>1342130987</td>
        </tr>
        <tr data-tt-id="3" data-tt-parent-id="1">
            <td ></td>
            <td>张三</td>
            <td>技术总监</td>
            <td>男</td>
            <td>afafa@163.com</td>
            <td>1342130987</td>
        </tr>
        <tr data-tt-id="2">
            <td >专员（4人）</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr data-tt-id="4" data-tt-parent-id="2">
            <td ></td>
            <td>张三</td>
            <td>技术总监</td>
            <td>男</td>
            <td>afafa@163.com</td>
            <td>1342130987</td>
        </tr>
        <tr data-tt-id="5" data-tt-parent-id="2">
            <td ></td>
            <td>张三</td>
            <td>技术总监</td>
            <td>男</td>
            <td>afafa@163.com</td>
            <td>1342130987</td>
        </tr>
        <tr data-tt-id="6" data-tt-parent-id="2">
            <td ></td>
            <td>张三</td>
            <td>技术总监</td>
            <td>男</td>
            <td>afafa@163.com</td>
            <td>1342130987</td>
        </tr>
        <tr data-tt-id="7" data-tt-parent-id="2">
            <td ></td>
            <td>张三</td>
            <td>技术总监</td>
            <td>男</td>
            <td>afafa@163.com</td>
            <td>1342130987</td>
        </tr>
        </tbody>
    </table>
</div>

<script type="text/javascript" src="./js/jquery-3.2.1.min.js"></script>
<script src="./lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="./js/xadmin.js"></script>
<script src="./js/jquery.treetable.js" type="text/javascript"></script>
<script type="text/javascript">
//    用了treetable插件
    $(function(){
        $("#treeTable1").treetable({ expandable: true });
        $("#treeTable1").treetable("expandAll");
    });
$(".zk").click(function () {
    $("#treeTable1").treetable("expandAll");
    return false;
});
    $(".gb").click(function () {
        $("#treeTable1").treetable("collapseAll");
        return false;
    });
</script>
<script>
    $(".sl").click(function () {
        var input = "<input type='text' id='temp' class=\"layui-input\"  placeholder=\"请输入\" value=" + $(this).text() + " >";
        $(this).text("");
        $(this).append(input);
        $("input#temp").focus();
        $("input").blur(function () {
            if ($(this).val() == ""||$("this").val()=="请输入") {
                $(this).remove();
                $("sl").text("请输入");
//              $("this").closest("td").text("请输入")
            } else {
                $(this).closest("td").text($(this).val());
            }
        });
    })

</script>
<script>

    function member_del(obj,id){
        var data=$(obj).parent().parent().children().html();
        console.log(data)
        layer.confirm('确认要删除'+data+'吗？',{title:'确认删除'},function(index){
            //发异步删除数据
            $(obj).parents("tr").remove();
            layer.msg('已删除!',{icon:1,time:1000});
        });
    }
</script>
<script>var _hmt = _hmt || [];
(function () {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();</script>
</body>

</html>